<div id = "product-list">
	<h1>Listing articles</h1>
	
	<table cellpadding="5" cellspacing="0">
	<% for article in @articles %>
		<tr valign = "top" class="<%=cycle('list-line-odd','list-line-even')%>">
			<td>
				<img class="list-image" src="<%=article.image_url %>"/>
			</td>
			<td>
				<%= h(article.section) %>
			</td>
			<td width="60%">
				<span class="list-title"> <%= h(article.title) %> </span><br/>
				by <%= h(article.author)%><br />
				<%= h(truncate(article.body, 80))%>
			</td>
			<td>
				<%= h(article.created_at) %>
			</td>
		
			<td class="list-actions">
				<%= link_to 'Show', :action => 'show', :id => article %><br />
				<%= link_to 'Edit', :action => 'edit', :id => article %><br />
				<%= link_to 'Destroy', {:action => 'destroy', :id => article},
									:confirm => "Are you sure?", 
									:method => :post %>
			</td>
		</tr>
	<%end%>
	</table>
</div>

<%= if @article_pages.current.previous 
		link_to("Previous page", { :page => @article_pages.current.previous }) 	
	end
%>
<%= if @article_pages.current.next
		link_to("Next page", { :page => @article_pages.current.next }) 
	end
%> 

<br />

<%= link_to 'New article', :action => 'new' %>
